/**
 * 
 */
package com.shanglida.main.need;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import com.shanglida.R;
import com.shanglida.base.BaseActivity;
import com.shanglida.main.TabFind;
import com.shanglida.main.find.WebActivity;

/**
 * @author liu
 * @deprecated 在考虑能不能重构一个界面view 我想偷懒
 * @date 2014-02-28 PM
 */
public class CultureActivity extends BaseActivity {
	private Button mbaike_ret;
	private ImageView mwhite, mwine, mspirits, mrose, mtea, mbubbly;
	Context mContext = CultureActivity.this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.baike_need_activity);
		initView();
		initData();

	}

	/*
	 * 
	 */

	@Override
	protected void initView() {
		mbaike_ret = (Button) findViewById(R.id.baike_ret);
		mwhite = (ImageView) findViewById(R.id.white_wine);
		mwine = (ImageView) findViewById(R.id.red_wine);
		mspirits = (ImageView) findViewById(R.id.spirits_wine);
		mrose = (ImageView) findViewById(R.id.rose_wine);
		mtea = (ImageView) findViewById(R.id.china_tea);
		mbubbly = (ImageView) findViewById(R.id.bubbly_wine);

	}

	@Override
	protected void initData() {
		mbaike_ret.setOnClickListener(this);
		mwhite.setOnClickListener(this);
		mwine.setOnClickListener(this);
		mspirits.setOnClickListener(this);
		mrose.setOnClickListener(this);
		mtea.setOnClickListener(this);
		mbubbly.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		// 返回界面
		case R.id.baike_ret:
			finish();
			break;
		// 白酒
		case R.id.white_wine:
			OpenWeb("http://baike.baidu.com/view/26712.htm");
			break;
		// 红酒
		case R.id.red_wine:
			OpenWeb("http://baike.baidu.com/subview/60391/4952820.htm?fromId=60391&from=rdtself");
			break;
		// 洋酒
		case R.id.spirits_wine:
			OpenWeb("http://baike.baidu.com/view/809628.htm");
			break;
		// 香槟酒
		case R.id.bubbly_wine:
			OpenWeb("http://baike.baidu.com/view/33367.htm?fromId=21221");
			break;
		// 花雕酒
		case R.id.rose_wine:
			OpenWeb("http://baike.baidu.com/subview/1038205/12032123.htm");
			break;
		// 茶叶
		case R.id.china_tea:
			OpenWeb("http://baike.baidu.com/view/3217.htm");
			break;

		default:
			break;
		}

	}

	// 设置跳转openweb
	private void OpenWeb(String URL) {
		Intent Web = new Intent();
		Web.putExtra("URL", URL);
		Web.setClass(CultureActivity.this, WebActivity.class);
		startActivityForResult(Web, RESULT_OK);
		// Log.i(">>>", "---啾啾--" + URL);
	}
}